//
//  UIColor+YCUIRule.h
//  HeartWorldClient
//
//  Created by 李珈旭 on 2016/11/25.
//  Copyright © 2016年 谭明权. All rights reserved.
//

#define BackgroundColor RGBACOLOR(239, 74, 101, 1)
//#define GreenColor RGBACOLOR(239, 74, 101, 1)
#define AlertTextColor RGBACOLOR(239, 74, 101, 1)
#define YCColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] //RGB颜色
#define RGBACOLOR(r,g,b,a) \
[UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:a] //RGB颜色
#define YCRandomColor RGBACOLOR(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), 1)// 随机色
#define GrayBgColor RGBACOLOR(238, 238, 238, 1)// 灰色背景
#define lineGrayColor RGBACOLOR(200, 200, 200, 1)//与系统TableviewCell线颜色相近的灰色
#define IncomePurpleColor [UIColor colorWithHexString:@"FC617B"]


#import <UIKit/UIKit.h>



/**
 * 背景颜色以及辅助色
 */
typedef NS_ENUM(NSUInteger, YCViewColor){
    
    
    YCVIColorMain = 0,     /**< 主色调 #ef4a65 枚红色 */
    YCVIColorSubOrange,    /**< 辅助色 #ff8400 橘黄色 */
    YCVIColorSubDarkMain,  /**< 辅助色 #d9324d 深主色 */
    YCVIColorSubLightMain, /**< 辅助色 #ff7a8f 浅主色 */
    YCVIColorSubFCGray,    /**< 辅助色 #fcfcfc 淡灰色 */
};

typedef NS_ENUM(NSUInteger,YCLineColor){
    YCLIColorThinMain = 0, /**< #ffb2bd 淡主色 */
    YCLIColorLightMain,    /**< #ff7a8f 浅主色 */
    YCLIColorCCGray,       /**< #cccccc 淡灰色 */
    YCLIColorBBGray,       /**< #bbbbbb 淡灰色 */
    YCLIColorE7Gray,       /**< #e7e7e7 淡灰色 */
    YCLIColorEEGray,       /**< #eeeeee 淡灰色 */
};

typedef NS_ENUM(NSUInteger,YCButtonColor){
    
    YCBUColorSelect = 0,   /**< #ef4a65 枚红色 */
    YCBUColorUnSelect,     /**< #dddddd 淡灰色 */
    
};

typedef NS_ENUM(NSUInteger,YCSystemColor){
    YCSYColorNavi = 0,    /**< #ff647c 枚红色 */
    YCSYColorGreen,       /**< #4db000  绿色 */
    YCSYColorOrange,      /**< #f09b1f 深黄色 */
};
typedef NS_ENUM(NSUInteger,YCFontColor){
    YCFTColorThree = 0,    /**< #333333  */
    YCFTColorSix,          /**< #666666  */
    YCFTColorNight,        /**< #999999  */
};
@interface UIColor (YCUIRule)

/**
 背景颜色以及辅助色的类方法

 @param type 背景色枚举
 @return UIColor
 */

+ (UIColor *)YCBackWith:(YCViewColor)type;

/**
 线条颜色的类方法

 @param type 线颜色枚举
 @return UIColor
 */
+ (UIColor *)YCLineWith:(YCLineColor)type;
/**
 按钮颜色的类方法
 
 @param type 线颜色枚举
 @return UIColor
 */
+ (UIColor *)YCButtonWith:(YCButtonColor)type;
/**
 一些系统颜色的类方法
 
 @param type 系统颜色枚举
 @return UIColor
 */
+ (UIColor *)YCBSystemWith:(YCSystemColor)type;

/**
 一些字体颜色的类方法
 
 @param type 字体颜色枚举
 @return UIColor
 */
+ (UIColor *)YCFontWith:(YCFontColor)type;

/**
 提示框背景色

 @return UIColor
 */
+ (UIColor *)YCAlertBGColor;

#pragma mark *************一些颜色初始化方法**************
/**
 *  Return a UIColor from an SVG color name
 *
 *  @param name The color name
 */
+ (UIColor *)colorFromName:(NSString *)name;

/**
 *  Return a UIColor using the HSL color space
 *
 *  @param hue The color's hue
 *  @param saturation The color's saturation
 *  @param lightness The color's lightness
 */
+ (UIColor *)colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation lightness:(CGFloat)lightness;

/**
 *  Return a UIColor using the HSL color space and an alpha value
 *
 *  @param hue The color's hue
 *  @param saturation The color's saturation
 *  @param lightness The color's lightness
 *  @param alpha The color's alpha value
 */
+ (UIColor *)colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation lightness:(CGFloat)lightness alpha:(CGFloat)alpha;

/**
 *  Return a UIColor from a 3- or 6-digit hex string
 *
 *  @param hexString The hex color string value
 */
+ (UIColor *)colorWithHexString:(NSString *)hexString;

/**
 *  Return a UIColor from a 3- or 6-digit hex string and an alpha value
 *
 *  @param hexString The hex color string value
 *  @param alpha The color's alpha value
 */
+ (UIColor *)colorWithHexString:(NSString *)hexString withAlpha:(CGFloat)alpha;

/**
 *  Return a UIColor from a RGBA int
 *
 *  @param value The int value
 */
+ (UIColor *)colorWithRGBAValue:(uint)value;

/**
 *  Return a UIColor from a ARGB int
 *
 *  @param value The int value
 */
+ (UIColor *)colorWithARGBValue:(uint)value;

/**
 *  Return a UIColor from a RGB int
 *
 *  @param value The int value
 */
+ (UIColor *)colorWithRGBValue:(uint)value;

/**
 *  Convert this color to HSLA
 *
 *  @param hue A float pointer that will be set by this conversion
 *  @param saturation A float pointer that will be set by this conversion
 *  @param lightness A float pointer that will be set by this conversion
 *  @param alpha A float pointer that will be set by this conversion
 */
- (BOOL)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation lightness:(CGFloat *)lightness alpha:(CGFloat *)alpha;

/**
 *  Determine if this color is opaque. Essentially, this returns true if the alpha channel is 1.0
 */
- (BOOL)isOpaque;

/**
 *  Adds percent to the lightness channel of this color
 */
- (UIColor *)darkenByPercent:(CGFloat)percent;

/**
 *  Subtracts percent from the lightness channel of this color
 */
- (UIColor *)lightenByPercent:(CGFloat)percent;

+ (UIColor *)randomColor;

@end
